import _ from 'lodash';
import './style.css';
import icon from './icon.png';
import Data from './data.xml';
import Notes from './data.csv';
import toml from './data.toml';
import yaml from './data.yaml';
import json from './data.json5';

console.log(toml.title); // output `TOML Example`
console.log(toml.owner.name); // output `Tom Preston-Werner`

console.log(yaml.title); // output `YAML Example`
console.log(yaml.owner.name); // output `Tom Preston-Werner`

console.log(json.title); // output `JSON5 Example`
console.log(json.owner.name); // output `Tom Preston-Werner`

function component() {
	const element = document.createElement('div');

	element.innerHTML = _.join(['你好！', 'webpack'], ' ');
	element.classList.add('hello');
	// 将图像添加到已经存在的 div 中。
	const myIcon = new Image();
	myIcon.src = icon;

	element.appendChild(myIcon);

	console.log(Data);
	console.log(Notes);
	return element;
}

document.body.appendChild(component());